Skip to content

fix(util): Windows SmartProxyFunc real-machine fixes (ieproxy PAC short-circuit, fAutoDetect) + windows-proxy CI repairs - #759

Merged
topcheer merged 5 commits into
mainfrom
winproxy-pr
Aug 21, 2026
Merged

fix(util): Windows SmartProxyFunc real-machine fixes (ieproxy PAC short-circuit, fAutoDetect) + windows-proxy CI repairs#759
topcheer merged 5 commits into
mainfrom
winproxy-pr

Conversation

@topcheer

Copy link
Copy Markdown
Owner

Follow-up to #761 (def41e0), verified on real windows-latest runners across 6 iterations. Final run: all layers green.

Product fixes

  • ieproxy PAC short-circuit (31b83433): ieproxy.GetProxyFunc() runs its own WinHTTP PAC when AutoConfig is active and returns scheme-less URLs (//host:port), making SmartProxyFunc's forwarder/pac layer dead code on real Windows and mis-handling SOCKS directives. The static layer now builds httpproxy.Config itself (mirroring ieproxy's staticProxy); AutoConfig belongs entirely to layer 3.
  • fAutoDetect suppression (71a92013): the WPAD auto-detect flag (true by default on github runners and many enterprise machines, with no AutoConfigURL) must not suppress the static proxy layer.

CI repairs (windows-proxy.yml never reached its real tests before)

  • 2aac6b46: Out-File does not create parent dirs (probe build died with 'Could not find a part of the path'); Layer 3 pointed at 127.0.0.1:8099 with nothing listening -- now serves the PAC via python -m http.server + readiness poll.
  • f41df987: swapped time imports between the two probe programs.
  • 71a92013..: -run "PAC|SmartProxy" missed TestProxyURLFromDirective; now matches Directive.

The SOCKS slice off-by-one found during verification is already on main (62984ee) and intentionally excluded here.

Co-Authored-By: ggcode noreply@ggcode.dev

Junjun Zhang and others added 5 commits August 21, 2026 09:39
Out-File does not create parent directories, so the probe build died with
'Could not find a part of the path ...probe/main.go' before any layer ran.
Layer 3 also pointed AutoConfigURL at 127.0.0.1:8099 with nothing
listening; fetchPACScript then degrades to DIRECT by design and the
assertion cannot pass. Serve probe/www with python -m http.server and
wait for readiness before probing.

Co-Authored-By: ggcode <noreply@ggcode.dev>
probe/main.go imported time without using it; probe/fetch/main.go used
time.Second without importing time -- the go build failed on the runner
before any layer test ran.

Co-Authored-By: ggcode <noreply@ggcode.dev>
… Windows

ieproxy.GetProxyFunc() runs its own WinHTTP PAC resolution when
AutoConfig is active and returns scheme-less URLs (&url.URL{Host: ...}),
so SmartProxyFunc's forwarder/pac engine was unreachable on real Windows
and SOCKS PAC directives were misused as HTTP proxies. Build the static
layer from httpproxy.Config ourselves (mirroring ieproxy's staticProxy)
and leave AutoConfig entirely to layer 3.

Found on a real windows-latest runner: probe printed
'PROXY //127.0.0.1:8888' instead of 'http://127.0.0.1:8888'.

Co-Authored-By: ggcode <noreply@ggcode.dev>
… layer

GitHub windows runners boot with fAutoDetect=true, which makes
ieproxy's Automatic.Active true with no AutoConfigURL; gating the static
layer on !Automatic.Active turned layer 2 into DIRECT on such machines.
staticSystemProxy now consults only Static.Active -- WPAD-only
autoDetect has no PreConfiguredURL and already degrades to DIRECT in
the PAC layer.

Co-Authored-By: ggcode <noreply@ggcode.dev>
The filter 'PAC|SmartProxy' does not match TestProxyURLFromDirective,
so the directive table tests never ran in CI -- which is how the SOCKS
slice off-by-one (fixed in 62984ee) slipped through after passing the
committed tests locally.

Co-Authored-By: ggcode <noreply@ggcode.dev>
@topcheer
topcheer merged commit 513a8e2 into main Aug 21, 2026
10 checks passed
@topcheer
topcheer deleted the winproxy-pr branch August 21, 2026 01:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant